Here's example code for using a GridBagLayout. Here's the same program, running as an applet:
Here's the same program, running as an applet: